String clazzTpl({package}) => """
import 'package:flutter/material.dart';
import 'base_store_container.dart';

class ThemeBuilder extends StatelessWidget {
  final void Function(Store<ReduxState>)? onInit;
  final void Function(Store<ReduxState>)? onInitialBuild;
  final void Function(Store<ReduxState>? old, Store<ReduxState> now)?
  onWillChange;
  final void Function(Store<ReduxState>? old, Store<ReduxState> now)?
  onDidChange;
  final void Function(Store<ReduxState>)? onDispose;
  final bool Function(ReduxState)? ignoreChange;
  final bool distinct;
  final bool rebuildOnChange;

  const ThemeBuilder({
    Key? key,
    this.onInit,
    this.onInitialBuild,
    this.onWillChange,
    this.onDidChange,
    this.onDispose,
    this.ignoreChange,
    this.distinct = false,
    this.rebuildOnChange = true,
    required this.builder,
  }) : super(key: key);

  final Widget Function(BuildContext context, ThemeState theme) builder;

  @override
  Widget build(BuildContext context) => BaseStoreContainer(
    onInit: (store) {
      StaticStore.store = store;
      if (onInit != null) onInit!(store);
    },
    distinct: distinct,
    onWillChange: onWillChange,
    onDidChange: onDidChange,
    onInitialBuild: onInitialBuild,
    onDispose: onDispose,
    rebuildOnChange: rebuildOnChange,
    ignoreChange: ignoreChange,
    builder: (context, theme, state, dispatch) {
      return builder(context, theme);
    },
  );
}
""";
